package com.newgd.blockchain.demo.controller;

import com.totoro.auth.service.AuthService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * Created by Niki on 2018/5/23 16:14
 */
@RestController
@RequestMapping("/demo")
public class DemoController {

    @RequestMapping(value = "/address", method = RequestMethod.GET)
    public String getAddress() {
        try {
            InetAddress host = InetAddress.getLocalHost();


            System.out.println(host.getHostName());
            System.out.println(host);
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        return "success";
    }

    @GetMapping("/auth")
    public String auth() {
        String auth = "";
        return auth;
    }

}
